<?php 
/***
 * 本文件用于更新已上传文件在数据库中的标志位
 * 标志位列名为isup
 */
	include_once('../sys/sys.php');
	
	header('Content-Type: text/html; charset=utf-8');
	
	$action = $_GET['action'];
	
	if ($action == 'elsesky'){
		//获取上传的文件名
		$file_name = $_GET['file_updated'];
		if (trim($file_name) == '') {
			echo "1";
			exit;
		}
		//查询总个数
		$totalnumbers = get_count_of_field('gfunappds'," downurl='" . $file_name . "'");
		if ($totalnumbers < 1) {
			echo "2";
			exit;
		}
		
		//查询数据库
		$result = $DB->build_and_exec_query( array(  
			'select' => 'appid',
		    'from'   => 'gfunappds',
		    'where'   => " downurl='" . $file_name . "'",
		)   );
//		echo $result['appid'];exit;
		//更新软件表中isup字段
		$DB->do_update('gfunapps', array(
				'isup'					=> 1,
		),
				'id=' . $result['appid'] . ''
		);
		
		echo "0";
		exit;
		
//		$result = $DB->build_and_exec_query( array(  
//			'select' => '*',
//		    'from'   => 'gfunapps',
//		    'where'   => " id=" . $result['appid'] . "",
//		)   );
//		
//		print_r($result);
		
		
	}
	

?>